import os, sys
import gfx
import input
import pygame
from pygame.locals import *

class _base:
        
    m_Input = None
    m_GFX = None
    m_FPS = 30
    m_Clock = None
    logger = None
    
# --------------------------------------------------------------------------------------    
    def __init__(self, log, h = 800, w = 600, depth = 16):
# -------------------------------------------------------------------------------------- 
        self.logger = log
        self.logger.log.info("Initializing Window Manager")
        pygame.init()
        self.m_Window = pygame.display.set_mode((h,w))
        pygame.display.set_caption('RND demo')
        
        #initialize graphics and clear the screen
        self.m_GFX = gfx._gfx(pygame.display.get_surface(),log)
        
        self.m_Input = input._input(log)

        self.m_Clock = pygame.time.Clock()
         
        
# --------------------------------------------------------------------------------------   
    def run(self):
# -------------------------------------------------------------------------------------- 
        while self.m_Input.parse() != input.Ev_QUIT :
            self.m_GFX.flip_buffers()  
                   

        